home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 2.toast / pc / sample code / quicktime / quicktime vr / vrscript / application files / comapplication.h < prev    next >
Encoding:
Text File  |  2000-09-28  |  5.1 KB  |  210 lines

  1. //////////
  2. //
  3. //    File:        ComApplication.h
  4. //
  5. //    Contains:    Application-specific code for scripting application.
  6. //
  7. //    Written by:    Tim Monroe
  8. //
  9. //    Copyright:    © 1994-1997 by Apple Computer, Inc., all rights reserved.
  10. //
  11. //    Change History (most recent first):
  12. //
  13. //       <5>         09/24/97    rtm        upgraded to latest QuickTime VR headers
  14. //       <4>         09/11/97    rtm        merged MacApplication.h and WinApplication.h
  15. //       <3>         08/21/97    rtm        begun adding Windows support
  16. //       <2>         11/27/96    rtm        conversion to personal coding style
  17. //       <1>         12/21/94    khs        first file
  18. //       
  19. //////////
  20.  
  21. #pragma once
  22.  
  23.  
  24. //////////
  25. //
  26. // compiler flags
  27. //
  28. //////////
  29.  
  30. #define BUG_2339989_OPEN            1        // is Radar bug 2339989 still unresolved?
  31. #define USE_SIOUX_FOR_DEBUG            0        // do we use SIOUX for verbose mode output?
  32.  
  33.  
  34. //////////
  35. //
  36. // header files
  37. //
  38. //////////
  39.  
  40. #ifndef __MOVIES__
  41. #include <Movies.h>
  42. #endif
  43.  
  44. #ifndef __MEDIAHANDLERS__
  45. #include <MediaHandlers.h>
  46. #endif
  47.  
  48. #ifndef __RESOURCES__
  49. #include <Resources.h>
  50. #endif
  51.  
  52. #ifndef __QUICKTIMEVR__
  53. #include <QuickTimeVR.h>
  54. #endif
  55.  
  56. #ifndef __SOUND__
  57. #include <Sound.h>
  58. #endif
  59.  
  60. #ifndef __SOUNDSPROCKET__
  61. #include <SoundSprocket.h>
  62. #endif
  63.  
  64. #ifndef __TEXTUTILS__
  65. #include <TextUtils.h>
  66. #endif
  67.  
  68. #ifndef __QTUtilities__
  69. #include "QTUtilities.h"
  70. #endif
  71.  
  72. #ifndef __QTVRUtilities__
  73. #include "QTVRUtilities.h"
  74. #endif
  75.  
  76. #ifndef __FileUtilities__
  77. #include "FileUtilities.h"
  78. #endif
  79.  
  80. #ifndef __URLUtilities__
  81. #include "URLUtilities.h"
  82. #endif
  83.  
  84. #include <stdio.h>
  85. #include <ctype.h>
  86. #include <stdlib.h>
  87. #include <string.h>
  88. #include <math.h>
  89.  
  90. #if TARGET_OS_MAC
  91. #include <AppleEvents.h>
  92. #include "MacFramework.h"
  93. #include "AppConfiguration.h"
  94. #endif
  95.  
  96. #if TARGET_OS_WIN32
  97. #include "WinFramework.h"
  98. #endif
  99.  
  100. #if USE_SIOUX_FOR_DEBUG
  101. #include <sioux.h>
  102. #endif
  103.  
  104. #include "ComResource.h"
  105. #include "VRMovies.h"
  106. #include "VR3DObjects.h"
  107. #include "VRSound.h"
  108. #include "VREffects.h"
  109. #include "VRSprites.h"
  110. #include "VRHash.h"
  111. #include "VRPreferences.h"
  112.  
  113.  
  114. //////////
  115. //
  116. // constants
  117. //
  118. //////////
  119.  
  120. #define kQTMaxSoundVolume        256
  121. #define kScriptFileSuffix        "txt"
  122.  
  123. enum {
  124.     kScriptFileType                = FOUR_CHAR_CODE('TEXT'),
  125.     kScriptFileCreator            = FOUR_CHAR_CODE('VRsc'),
  126.     kPrefsFileType                = FOUR_CHAR_CODE('VRpr'),
  127.     kPrefsFileCreator            = kScriptFileCreator
  128. };
  129.  
  130. enum eAppMenus {
  131.     mTesting = 131
  132. };
  133.  
  134. enum eTestingMenu {
  135.     iTest1 = 1,
  136.     iTest2,
  137.     iTest3,
  138.     iTest4
  139. };
  140.  
  141. enum {
  142.     iTest1Item = MENU_IDENTIFIER(mTesting, iTest1),
  143.     iTest2Item,
  144.     iTest3Item,
  145.     iTest4Item
  146. };
  147.  
  148.  
  149. //////////
  150. //
  151. // structures
  152. //
  153. //////////
  154.  
  155. // application-specific data;
  156. // this data applies to a specific VR movie/window combination
  157. typedef struct ApplicationDataRecord {
  158.  
  159.     // *** QTVR callback procedures ***
  160.     QTVRBackBufferImagingUPP    fBackBufferProc;    // a routine descriptor for our back buffer routine
  161.     QTVRImagingCompleteUPP        fPrescreenProc;        // a routine descriptor for our prescreen routine
  162.     
  163.     // *** General data ***
  164.     Boolean                        fViewHasChanged;    // has the (pan, tilt, or FOV of the) view changed?
  165.     Boolean                        fSoundHasChanged;    // has some sound changed?
  166.     
  167.     // *** Embedded QuickTime movie data ***
  168.     Boolean                        fBackBufferIsHoriz;    // is the backbuffer oriented horizontally?
  169.     
  170.     // *** SoundSprocket data ***
  171.     SSpListenerReference        fListener;            // the single listener
  172.     
  173.     // *** 3D object data ***
  174.     TQ3ViewObject                fView;                // the view for the scene
  175.     GWorldPtr                    fQD3DDCGWorld;        // the offscreen graphics world used for the pixmap draw context
  176.     Boolean                        fQD3DFOVIsVert;        // is the QD3D camera FOV vertical?
  177.     RGBColor                    fQD3DKeyColor;        // the color for chroma key compositing for QD3D textures (this is also the background color for the QD3D draw context)
  178.  
  179.     // *** QuickTime video effects data ***
  180.     GWorldPtr                    fSourceGWorld;        // the offscreen graphics world for the source node picture
  181.     GWorldPtr                    fTargetGWorld;        // the offscreen graphics world for the target node picture
  182.     ImageDescriptionHandle        fSourceGWDesc;        // the image description of the source offscreen graphics world
  183.     ImageDescriptionHandle        fTargetGWDesc;        // the image description of the target offscreen graphics world
  184.     VRScriptTransitionPtr        fActiveTransition;    // pointer to the list entry of the active node transition effect
  185.  
  186.     // *** Sprite data ***
  187.     Boolean                        fMovieHasSprites;    // does the movie have a sprite track?
  188.     MediaHandler                fSpriteHandler;        // the media handler for any sprite tracks
  189.     
  190.     // *** Array of our linked list head pointers ***
  191.     struct VRScriptGeneric        *fListArray[kVRScript_FinalEntryType + 1];
  192.     
  193. } ApplicationDataRecord, *ApplicationDataPtr, **ApplicationDataHdl;
  194.  
  195.  
  196. //////////
  197. //
  198. // function prototypes
  199. //
  200. //////////
  201.  
  202. #if TARGET_OS_MAC
  203. void                    InstallAppleEventHandlers (void);
  204. PASCAL_RTN OSErr        HandleOpenApplicationAppleEvent (const AppleEvent *theMessage, const AppleEvent *theReply, long theRefcon);            
  205. PASCAL_RTN OSErr        HandleOpenDocumentAppleEvent (const AppleEvent *theMessage, const AppleEvent *theReply, long theRefcon);
  206. PASCAL_RTN OSErr        HandlePrintDocumentAppleEvent (const AppleEvent *theMessage, const AppleEvent *theReply, long theRefcon);
  207. PASCAL_RTN OSErr        HandleQuitApplicationAppleEvent (const AppleEvent *theMessage, const AppleEvent *theReply, long theRefcon);
  208. #endif    // TARGET_OS_MAC
  209.  
  210. // the other function prototypes are in the file MacFramework.h or WinFramework.h